#include "snakes.h"

void game()
{
    int ch = 0;
    do
    {
        //创建贪吃蛇
        Snake snake = { 0 };
        //游戏初始化
        srand((unsigned int)time(NULL));
        GameStart(&snake);
        //运行游戏
        GameRun(&snake);
        //游戏结束
        GameEnd(&snake);
        SetPos(28, 15);
        printf("再来一局吗？(Y/N):");
        ch = getchar();
        while(getchar() != '\n');
    } while (ch == 'Y' || ch == 'y');
    SetPos(0, 28);
}
int main()
{
    char* loc = setlocale(LC_ALL,"");
    game();
    return 0;
}